/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rtype;

import java.awt.Image;
import java.awt.Rectangle;
import javax.swing.ImageIcon;

/**
 *
 * @author Administrator
 */
public class Alien {

       private String craft="Image/alien.png";

    private int dx;
    private int dy;
    private int x;
    private int y;
    private int width;
    private int height;
    private boolean visible;
    private Image image;

      public Alien(int x, int y) {
        ImageIcon ii = new ImageIcon(craft);
        image = ii.getImage();
        width = image.getWidth(null);
        height = image.getHeight(null);
        visible = true;
        this.x = x;
        this.y = y;
    }

      public void move(){
          if(x<0) x=400;
          x-=1;
      }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public Image getImage() {
        return image;
    }

    public Rectangle getBounds(){
        return new Rectangle(x, y, width, height);
    }

}
